<script setup>
import Html2Pdf from "./html2Pdf"
const el = ref()
const start = (title) => {
  const html2pdf = new Html2Pdf({
    title,
    el: el.value,
    type: "a4",
    beforeFn() {
      console.log("before")
    },
    afterFn() {
      console.log("after")
    }
  })
  html2pdf.start()
}

defineExpose({ start })  
</script>

<template>
  <div ref="el" class="absolute left-0 top-0">
    <slor />
  </div>
</template>